#define TYPE_HELLO 1
#define TYPE_GOODBYE 2
#define TYPE_DATA 3
#define TYPE_ACK 4
#define MAX_PKT_SIZE 64
#define HEADER_SIZE 4

int type;
int sequenceNumber;
char value[MAX_PKT_SIZE];

void GoBackNPacket(int typeIn, int sequenceNumberIn, char *valueIn) {
      type = typeIn;
      sequenceNumber = sequenceNumberIn;
      value = valueIn;
}

/**
* Constructor that initializes values from a DatagramPacket
*/
void GoBackNPacket(char *packet, int length) {
      int i;
      type = packet[0];
      sequenceNumber = packet[1];
      for(i)
      value = data[2];
}

/**
* Test if is a Hello-type packet
*/
int isHello() {
      if(type == TYPE_HELLO){
        return 0;
      } else {
        return -1;
      }
}

/**
* Test if is a Goodbye-type packet
*/
int isGoodbye() {
      if(type == TYPE_GOODBYE){
        return 0;
      } else {
        return -1;
      }
}

/**
* Test if is a Data-type packet
*/
int isData() {
      if(type == TYPE_DATA){
        return 0;
      } else {
        return -1;
      }
}

/**
* Test if is an ACK-type packet
*/
int isAck() {
      if(type == TYPE_ACK){
        return 0;
      } else {
        return -1;
      }
}

/**
* Get the sequence number of packet
*/
int getSequenceNumber() {
      return sequenceNumber;
}

/**
* Get the data value from packet
*/
void char getValue() {
      return value;
}

/**
* Convert GoBackNPacket to a DatagramPacket
*/
void DatagramPacket toDatagramPacket() {
      int[] data = new int[3];
      data[0] = type;
      data[1] = sequenceNumber;
      data[2] = value;
      return 
}